 #include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<list>
#include<cstdlib>
#include<cmath>
#include<sstream>
#include<numeric>
#include<cstdio>
#include<cstring>
#include<stack>
using namespace std;
typedef long long LL;
const int maxn=305;
const int INF=1000000000;
int dp[maxn<<1][maxn][maxn],a[maxn][maxn],n;
//dp[i][j][k] means p1 p2 has been walked for i road long and p1 in x is j while p2 in x is k
int dfs(int s,int i,int j){
	if(i>n||j>n||s-i>n||s-j>n)return -INF;
	if(i==n&&j==n&&s-i==n&&s-j==n)return a[n][n];
	if(dp[s][i][j]!=-INF)return dp[s][i][j];
	int res=a[i][s-i];
	if(i!=j)res+=a[j][s-j];
	for(int x=0;x<2;x++)for(int y=0;y<2;y++){
		dp[s][i][j]=max(dp[s][i][j],dfs(s+1,i+x,j+y)+res);
		}
	return dp[s][i][j];
	}
int main(){
	while(scanf("%d",&n)!=EOF){
		for(int i=1;i<=n;i++)for(int j=1;j<=n;j++)scanf("%d",&a[i][j]);
		for(int i=0;i<=n+n;i++)for(int j=0;j<=n;j++)for(int k=0;k<=n;k++)dp[i][j][k]=-INF;
		cout<<dfs(2,1,1)<<endl;
		}
    return 0;
    }
